<%@page import="com.news.entity.News"%>
<%@page import="java.util.List"%>
<%@page import="com.news.dao.NewsDao"%>
<%@page import="com.news.dao.impl.NewsDaoImpl"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<%@include file="types.jsp" %>
<h2>分类：
<%
//此方法返回值为String
String strtid=request.getParameter("tid");
int tid=Integer.parseInt(strtid);
out.print(tid);
switch(tid){
case 1:out.print("国内");break;
case 2:out.print("政治");break;
case 3:out.print("体育");break;
case 4:out.print("娱乐");break;
}
%>
</h2>
<hr/>
	<%

NewsDao ndao=new NewsDaoImpl();
List<News> newslist=ndao.getNewsByTid(tid);
for(News news:newslist){
	out.print(news+"<br>");
}
%>
</body>
</html>